import requests

from test.api.login import get_verity_code, login
import config
import os

from test.tools.dbutil import DBUtil

# 上传合同
# uuid=get_verity_code().json().get("uuid")
# a=login("admin","HM_2023_test",uuid)
# token=a.json().get("token")
# response1=requests.post(url=config.BASE_URL+"/api/common/upload",
#              files={"file":open(r"C:\Users\23920\Pictures\Camera Roll\th.jpg","rb")}
#              , headers={"Authorization":token}
#              )
# print(response1.text)
print(DBUtil.exe_sql("select * from tb_contract where phone='17388038301'"))
# 使用os获取当前文件的路径
# print(os.path.dirname(__file__))
# response2=requests.post(url=config.BASE_URL+"/api/contract",headers={"Authorization":token}
#               ,json={
#     "name": "测试888",
#     "phone": "17388038301",
#     "contractNo": "HT23920693",
#     "subject": "6",
#     "courseId": 99,
#     "channel": "0",
#     "activityId": 77,
#     "fileName": "http://localhost:8080/profile/upload/2024/12/27/78d952e8-fb1f-42b4-8090-92012515ce56.jpg"
# }
#               )
# print(response2.text)


